<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
* 新增加三个函数
*/
class MY_Loader extends CI_Loader
{
	
	function __construct()
	{
		parent::__construct();
	}

	/**
	 * 在view下面增加主题
	 * @param string $path
	 * @param boolean $view_cascade
	 */
	public function add_view_path($path, $view_cascade = FALSE)
	{
		$path = rtrim($path,'/').'/';
		$this->_ci_view_paths = array(APPPATH.'views/'.$path => $view_cascade) + $this->_ci_view_paths;
	}

	/**
	 * 加载模板下面的templates
	 * @param string $view
	 * @param array $vars
	 * @param boolean $return
	 * @return ci_view 
	 */
	public function view_tpls($view, $vars = array(), $return = FALSE)
	{
		return $this->_ci_load(array('_ci_view' => 'templates/'.$view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
	}

	/**
	 * 加载模板下面的common
	 * @param string $view
	 * @param array $vars
	 * @param boolean $return
	 * @return ci_view
	 */
	public function view_common($view, $vars = array(), $return = FALSE)
	{
		return $this->_ci_load(array('_ci_view' => 'common/'.$view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
	}
}

/* End of file MY_Loader.php */
/* Location: ./application/core/MY_Loader.php */